Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the code search to sort results by relevance #32134

Merged
merged 2 commits into from
Sep 28, 2024

Conversation

bsofiato
Copy link
Contributor

Resolves #32129

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Sep 25, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Sep 25, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Sep 25, 2024
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Sep 25, 2024
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Sep 27, 2024
@lunny
Copy link
Member

lunny commented Sep 27, 2024

And I found it's wired when using fuzzy search with bleve. Some fuzzy results' scores bigger than exact match results' . So is there an sort option so that exact match will be always before fuzzy results?

Signed-off-by: Bruno Sofiato <bruno.sofiato@gmail.com>
@bsofiato
Copy link
Contributor Author

bsofiato commented Sep 27, 2024

And I found it's wired when using fuzzy search with bleve. Some fuzzy results' scores bigger than exact match results' . So is there an sort option so that exact match will be always before fuzzy results?

Hey @lunny , I can take a look into it. I'm not familiar with bleve, but I'm gonna check !! Off the top of my head, we can do an OR query and assign a greater weight to statement that uses exact match.

BTW, I'm working on #32096 and I had to rework the query. Maybe I can enhance it further to boost the score of exact matches there. What do you think ?

@lafriks
Copy link
Member

lafriks commented Sep 27, 2024

I think that can be improved in other PR when implementing advanced search queries

@lunny lunny added reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. type/enhancement An improvement of existing functionality labels Sep 28, 2024
@lunny lunny added this to the 1.23.0 milestone Sep 28, 2024
@lunny lunny enabled auto-merge (squash) September 28, 2024 19:44
@lunny lunny merged commit 99d0510 into go-gitea:main Sep 28, 2024
26 checks passed
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Sep 28, 2024
zjjhot added a commit to zjjhot/gitea that referenced this pull request Sep 30, 2024
* giteaofficial/main:
  Change the code search to sort results by relevance (go-gitea#32134)
  [skip ci] Updated translations via Crowdin
  Add pure SSH LFS support (go-gitea#31516)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sort the code search result by relevance
5 participants